import {httpGet, httpPost, httpDelete, httpPut} from '../services/http'
import {BaseDTO} from './base'
declare type Int64 = number

export interface TradByCustomerDTO {
  customerInfo: CustomerInfoDTO[]
  projectInfo: ProjectInfoDTO[]
}

export interface CustomerInfoDTO {
  id: string
  name: string
  tell: string
  idNumber: string
}

export interface ProjectInfoDTO {
  tradeList: TradeDTO[]
  projectName: string
  bank: string
  bankNumber: string
}

export interface TradeDTO {
  id: string
  tradeCode: string
  createDate: string
  endDate: string
  feeInfo: []
  bank: string
  bankNumber: string
}

export interface FeeInfoDTO {
  id: string
  accrualDate: string
  money: string
  //0:已收取全额费用，1:费用待补全
  status: string
  getInInfo: InInfoDTO[]
}

export interface InInfoDTO {
  id: string
  money: string
  getInDate: string
  customerInfo: string
  orderNumber: string
  //0:未开单，1:已开单；已开单退款后，同一单据下的实收全部更新为未开单，且改单据更新为作废
  voucherStatus: string
}

export default {
  info: {
    getTradByCustomerInfo(params: {
      //身份证号
      idNumber: string
      //1:楼款，2:代收费,3:暂收款.4:滞纳金
      type: string
      //当前选择的项目ID
      projectId: string
    }): Promise<TradByCustomerDTO> {
      let path = `/api/pos-app/getTradByCustomerInfo`
      return httpGet(path, {params}).then(res => res.data.data)
    },
  },
}
